#include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        if (s1.length() < s2.length())return false;
        unordered_map<char, int> aa;
        for (char a : s1) {
            aa[a]++;
        }
        for (char b : s2) {
            aa[b]--;
            if (aa[b] < 0)return false;
        }
        return true;
    }
};
class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        if (s1.length() != s2.length())return false;
        vector<int>aa(26, 0);
        for (char a : s1) {
            aa[a - 'a']++;
        }
        for (char b : s2) {
            aa[b - 'a']--;
            if (aa[b - 'a'] < 0) {
                return false;
            }
        }
        return true;
    }
};